package com.gykfbxxh.imovie.config;

import android.app.Activity;
import android.content.Intent;

import com.gykfbxxh.imovie.base.BaseActivity;
import com.gykfbxxh.imovie.bean.film.FilmEntity;
import com.gykfbxxh.imovie.view.filmsdetail.acitivity.FilmDetailActivity;

/**
 * Created by xuxinghai
 * On 2017/8/17
 * 一些类型常量
 */

public class TypeConstant {

    /**************LoadView的空View类型****************/
    public final static int EMPTY_DEFAULT = 0;//空--小老虎
    public final static int EMPTY_COLLECTION = 1;//空--收藏的
    public final static int EMPTY_2= 2;//空--带表的
    public final static int EMPTY_3 = 3;//空--带毛笔的

    /**************页面类型****************/
    public final static String SOURCETYPE_NORMAL = "1";

    public final static String PAGE_ONE_IMAGE = "1";//新闻类型
    public final static String PAGE_VIDEO = "2";//视频类型

    //用于栏目适配用
    public final static String CHANNEL_TYPE_NEWS = "1";//文章栏目类型
    public final static String CHANNEL_TYPE_PICS = "2";//图集栏目类型
    public final static String CHANNEL_TYPE_VIDEO = "3";//视频栏目类型

    /**************** 评论类型 ******************/
    public final static String COMMENT_PARENT = "0";//对文章的评论
    public final static String COMMENT_ONE = "1";//一级评论
    public final static String COMMENT_TWO = "2";//二级评论
    /**************** 评论类型 ******************/

    /**************zan类型****************/
    public final static String ZAN_NORMAL= "0";//帮上头条
    public final static String ZAN_CANCLE = "1";//取消赞
    public final static String ZAN_DISLIKE = "2";//不喜欢

    public final static String PUSH_FOCUSNEWS = "1";//要闻-弹dialog-不弹通知栏
    public final static String PUSH_NORMAL = "0";//普通推送——弹出通知栏
    public final static String PUSHTYPE_UMENG = "2";//友盟推送的value


    /**
     * 公用的跳转新闻方法
     * @param newsEntity
     * @param activity
     */
    public static boolean openTypeDetail(FilmEntity newsEntity, Activity activity, String sourceType){

        if (activity == null || newsEntity == null ) {
            return false;
        }
        Intent intent = new Intent();
        intent.setClass(activity,FilmDetailActivity.class);
        intent.putExtra(BaseActivity.PARAMETER1, newsEntity.getFId());
        intent.putExtra(BaseActivity.PARAMETER2, sourceType);
        activity.startActivity(intent);
        return true;
    }
}
